package com.sgb.zhaocai.entity;

import android.text.TextUtils;

import com.swgk.core.util.DateUtils;

import java.math.BigDecimal;

/**
 * Time:2021/7/2
 * AUTHOR:F_Q
 * Description:
 */
public class LabourWorkListEntity {
    /**
     *  {
     *    "no": "900a4d8af7764b91ab87e997702bdc52",
     *    "unit": "m2",
     *    "planUseTime": "2021-07-15 00:00:00",
     *    "itemizedUseAmount": 23,
     *    "memo": "\/",
     *    "itemProject": "块料楼地面（楼面）",
     *    "partitionedProjectName": "天棚工程",
     *    "projectId": "1405002916691054592",
     *    "projectAddressName": "山西省 \/ 大同市 \/ 新荣区",
     *    "partitionedProjectNo": "64272d4aeff5413aab456cc85751fb3d",
     *    "itemProjectNo": "0effd266228c437c90a0324a6290b832"
     *  },
     */
    private String id;
    private String projectId;
    private String businessPlanId;
    private String type;
    private String no;
    private String partitionedProjectNo;
    private String itemProjectNo;
    private String itemProject;
    private String partitionedProjectName;
    private String memo;
    private String projectAddressName;
    private String planUseTime;
    private String itemizedUseAmount;
    private String unit;
    private boolean offerState;
    private String offerCount;
    private String compNo;

    public String getCompNo() {
        return compNo;
    }

    public void setCompNo(String compNo) {
        this.compNo = compNo;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBusinessPlanId() {
        return businessPlanId;
    }

    public void setBusinessPlanId(String businessPlanId) {
        this.businessPlanId = businessPlanId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean getOfferState() {
        return offerState;
    }

    public void setOfferState(boolean offerState) {
        this.offerState = offerState;
    }

    public String getOfferCount() {
        return offerCount;
    }

    public void setOfferCount(String offerCount) {
        this.offerCount = offerCount;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getPlanUseTime() {
        if (!TextUtils.isEmpty(planUseTime)){
            String timestamp = DateUtils.timestampToDate(Long.parseLong(planUseTime));
            return timestamp;
        }else {
            return "";
        }
    }

    public void setPlanUseTime(String planUseTime) {
        this.planUseTime = planUseTime;
    }

    public String getItemizedUseAmount() {
        if (!TextUtils.isEmpty(itemizedUseAmount)){
            BigDecimal big = new BigDecimal(itemizedUseAmount);
            big = big.stripTrailingZeros();
            return big.toPlainString();
        }else {
            return "";
        }
    }

    public void setItemizedUseAmount(String itemizedUseAmount) {
        this.itemizedUseAmount = itemizedUseAmount;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getItemProject() {
        return itemProject;
    }

    public void setItemProject(String itemProject) {
        this.itemProject = itemProject;
    }

    public String getPartitionedProjectName() {
        return partitionedProjectName;
    }

    public void setPartitionedProjectName(String partitionedProjectName) {
        this.partitionedProjectName = partitionedProjectName;
    }

    public String getProjectAddressName() {
        if (!TextUtils.isEmpty(projectAddressName)){
            String replace = projectAddressName.replace("/", "");
            return replace.replace(" ","");
        }else {
            return "";
        }
    }

    public void setProjectAddressName(String projectAddressName) {
        this.projectAddressName = projectAddressName;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getPartitionedProjectNo() {
        return partitionedProjectNo;
    }

    public void setPartitionedProjectNo(String partitionedProjectNo) {
        this.partitionedProjectNo = partitionedProjectNo;
    }

    public String getItemProjectNo() {
        return itemProjectNo;
    }

    public void setItemProjectNo(String itemProjectNo) {
        this.itemProjectNo = itemProjectNo;
    }
}
